//
//  TabViews.swift
//  SwiftUI-CTao
//
//  Created by 涛 on 2019/9/17.
//  Copyright © 2019 涛. All rights reserved.
//

import SwiftUI

struct TabViews: View {
    
    @State private var selectIndex = 0
    
    var body: some View {
        TabView(selection: $selectIndex) {
            Text("\(self.selectIndex)")
                .tabItem {
                    Image(systemName: "1.circle")
                    Text("1")
                }.tag(0)
            Text("\(self.selectIndex)")
                .tabItem {
                    Image(systemName: "2.circle")
                    Text("2")
                }.tag(1)
        }
    }
}

struct TabViews_Previews: PreviewProvider {
    static var previews: some View {
        TabViews()
    }
}
